<template>
	<div class="person">
		<h2>水温：{{temp}}摄氏度</h2>
		<h2>水位：{{high}}米</h2>
		<button @click="changeTemp"></button>
		<button @click="changeHeight"></button>
	</div>
</template>
<script lang="ts" setup>
import { ref, watch, watchEffect} from 'vue';

let temp = ref(0)
let high = ref(0)

function changeTemp(){
	temp.value += 10
}
function changeHeight(){
	high.value +=10
}

watchEffect(()=>{
	if(temp.value>=60||high.value>=80){
		console.log("给服务器发送请求");
	}	
})

</script>
<style>
.person {
	padding: 10px;
}
</style>
